<template>
  <div id="myAccount">
    <header>
      <div class="title">
        <img src="../../image/retern_wrong_topic.png" alt="" width="33" height="33" @click="goBack()"> 我的账户
      </div>
      <div>
        <p>我的账户余额:</p>
        <i>
          <b>{{account}}</b>元</i>
      </div>
    </header>
    <ul>
      <li>
        <router-link to="/recharge">
           <img src="../../image/recharge.png" alt="">     
          <h3>充值</h3>
          <span></span>
        </router-link>
      </li>
      <li>
        <router-link to='/withdraw'>
            <img src="../../image/withdraw.png" alt="">     
          <h3>提现</h3>
          <span></span>
        </router-link>
      </li>
      <!-- <li>
	  			<a @click="goNext">
					<h3>我的收益</h3>
		 			<b v-show='openSure'>认证开启后</b>
		 			<b v-show='!openSure'>开启认证</b>
		 			<span></span>
	  			</a>
            </li> -->
      <!-- <li>
	  			<a @click="goNext">
					<h3>我的认证</h3>
		 			<b v-show='openSure'>认证开启后</b>
		 			<b v-show='!openSure'>开启认证</b>
		 			<span></span>
	  			</a>
            </li> -->
    </ul>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        userid: '',
        account: ''
        // list: [],
        // openSure: false  //开启认证 默认未开启
      }
    },
    components: {

    },
    methods: {
      goBack() {
        this.$router.push({
          path: '/my'
        })
      },
      // goNext() {
      // 		this.$router.push({path:'/authentication'})
      // },
           // 登录拦截
           isLogin() {
        this.userid = localStorage.getItem("loginMobile");
        if (!this.userid) {
          this.$router.push('/login1')
          return false;
        } else {
          return true;
        }
      },
      init() {
        this.userid = localStorage.getItem("loginMobile");
        this.$api.get(this.$api.baseURLSchool, "/no_page/user?id=" + this.userid, {}, r => {
          if (r.data.ret == 1) {
            this.account =r.data.info[0].money;
          }
          if (r.data.ret == -3) {
              localStorage.clear();
              this.isLogin()
            }
        }, err => {
          console.log(err);
        })
      }


    },
    created() {
      this.init()

    }
  }

</script>
<style lang="scss">


</style>
